package com.xmy.cultivate.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xmy.cultivate.enums.ArriveAffirmEnum;
import com.xmy.cultivate.enums.OrderTypeEnum;
import com.xmy.cultivate.enums.StatusOrderApplyEnum;
import com.xmy.cultivate.enums.ReadingStatusEnum;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 订单报名信息
 * </p>
 *
 * @author min
 * @since 2022-08-01
 */
@TableName("order_detail")
@Data
public class OrderDetail implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */

    private Long id;

    /**
     * 订单id
     */
    
    private Long orderId;

    @ExcelIgnore
    private String lklOrderNo;

    /**
     * 课程id
     */
    
    private Long courseId;

    private String courseName;

    private Long subjectsId;

    private Integer yearClassId;

    private Integer lessonType;

    /**
     * 班级id
     */
    
    private Long gradeId;

    private String gradeName;

    /**
     * 价格id
     */
    
    private Long coursePriceId;

    private String coursePriceName;

    /**
     * 数量
     */
    private Integer count;

    /**
     * 共多少课时
     */
    private Integer allCourseCount;

    /**
     * 使用课时
     */
    private Integer useCourseCount;

    /**
     * 剩余课时
     */
    private Integer residueCourseCount;


    private BigDecimal usePrice;

    /**
     * 转出金额
     */
    private BigDecimal rollOutPrice;

    /**
     * 转出课时
     */
    private Integer rollOutHouse;

    /**
     * 退费金额
     */
    private BigDecimal outPrice;

    /**
     * 退费课时
     */
    private Integer outHouse;

    /**
     * 转校退费金额
     */
    private BigDecimal turnOutPrice;

    /**
     * 转校退费课时
     */
    private Integer turnOutHouse;

    /**
     *累计转校转出已使用金额（已经记上课的）
     */
    private BigDecimal turnOutUsePrice;

    /**
     * 累计转校转出已使用课时（已经记上课的）
     */
    private Integer turnOutUseHouse;


    /**
     * 应收金额
     */
    private BigDecimal price;

    private StatusOrderApplyEnum status;

    private ArriveAffirmEnum arriveAffirm;

    /**
     * 实收金额
     */
    private BigDecimal solidPrice;

    /**
     * 优惠金额
     */
    private BigDecimal discountsPrice;

    /**
     * 异常收入
     */
    private BigDecimal abnormalPrice;

    private LocalDate discountsDate;

    /**
     * 剩余金额
     */
    private BigDecimal residuePrice;

    private BigDecimal servePrice;

    private BigDecimal materialsPrice;

    /**
     * 教材费
     */
    private BigDecimal textBookPrice;

    /**
     * 有效期
     */
    private String validityDate;

    /**
     * 对内备注
     */
    private String innerRemark;

    /**
     * 对外备注
     */
    private String outerRemark;

    /**
     * 1在读，2转课（转出），3退费，4停课，5结课
     */
    private ReadingStatusEnum readingStatus;

    private OrderTypeEnum orderType;

    private Integer version;

    /**
     * 报名类型：1线下报名，2线上报名
     */
    private Integer signType;


    @TableLogic
    private Integer deleted;

    @TableField(fill = FieldFill.INSERT)
    private Long createdId;

    //顺延出课时数
    private Integer autoOutHouse;

    @TableField(exist = false)
    private Integer diffCount;

    /**
     * 经办日期
     */
    private LocalDate handleDate;

    /**
     * created_at
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    /**
     * updated_at
     */
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    /**
     * deleted_at
     */
    private LocalDateTime deletedAt;

    
    private Long studentId;

    
    private Long schoolId;


    /**
     * 报读类型
     */
    private Integer enrollType;



    /**
     * 是否新生，0否，1是
     */
    private Integer isNewStudent;

    private  Integer yearPart;

    private  Integer quarterNum;

    private Integer yearAndQuarter;

    private Integer freezeCourseCount;

    /**
     * 一课次多少个课时
     */
    private Integer courseHouse;

    private BigDecimal freezePrice;


    @TableField(exist = false)
    private Course course;

    @TableField(exist = false)
    private Organization organizationModel;

    @TableField(exist = false)
    private CoursePricing coursePricingModel;

    @TableField(exist = false)
    private CoursePricing orderCoursePricingModel;

    @TableField(exist = false)
    private List<OrderDisDetail> orderDisDetailList;

    /**
     * 报一科的学员人数
     */
    @TableField(exist = false)
    private Integer oneSubject;

    /**
     * 报两科的学员人数
     */
    @TableField(exist = false)
    private Integer twoSubjects;

    /**
     * 报三科的学员人数
     */
    @TableField(exist = false)
    private Integer threeSubjects;

    /**
     * 学员总人数
     */
    @TableField(exist = false)
    private Integer numStudents;

    /**
     * 转科前的科目
     */
    @TableField(exist = false)
    private Integer previousSubject;

    /**
     * 转科后的科目
     */
    @TableField(exist = false)
    private Integer currentSubject;

    /**
     * 转科数量
     */
    @TableField(exist = false)
    private Integer transferCount;

    @TableField(exist = false)
    private Long teacherId;

    @TableField(exist = false)
    private String teacherName;

    @TableField(exist = false)
    private String schoolName;

    @TableField(exist = false)
    private String subjectsName;

    @TableField(exist = false)
    private String studentName;

    /**
     * 转出班级id(记录转校时自动创建班级是否已经创建)
     */
    private Long outId;

    /**
     * 转出校区详情id
     */
    private Long changeSchoolDetailId;

    /**
     * 学生id队列
     */
    @ExcelIgnore
    @TableField(exist = false)
    private List<Long> studentList;

    @ExcelIgnore
    private Integer payType;
}
